package com.xhu.collegestudentrentalsystem.util;

import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;

import java.util.Map;

/**
 * @author zhu huilin
 * @date 2023/2/26 20:11
 */
public class HTMLTemplateUtils {
    private final static TemplateEngine templateEngine = new TemplateEngine();

    public static String render(String template, Map<String, Object> params){
        Context context = new Context();
        context.setVariable("username", "张三");
        return templateEngine.process(template, context);
    }
}
